<%--
    Document   : statistic
    Created on : Dec 4, 2011, 9:37:04 PM
    Author     : Venus
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="java.util.*,  Beans.ThamSoHT,Models.ThamSoHT_Model, Models.NhomMA_Model, Models.KhuVuc_Model"%>
<!--
Danh sách các tham số hệ thống ở trang này :
order      areainfo     areamsg     status      arealang
newarea    areaname     save        action      arealist
enable     disable      search
-->
<%
            int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
            String dsts = " 'year', 'viewchart', 'nameofcustomer', 'quantity', 'numberofcustomer', 'quantitytable', 'quantityuser', 'quantityfood', 'table', 'area', 'rightmsg', 'nameofuser', 'notice', 'foodgroups', 'food', 'enddate', 'datestart', 'all' ";
            ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.

            String all = mdsts[0].getTenTS();
            String area = mdsts[1].getTenTS();
            String datestart = mdsts[2].getTenTS();
            String enddate = mdsts[3].getTenTS();
            String food = mdsts[4].getTenTS();
            String foodgroups = mdsts[5].getTenTS();
            String nameofcustomer = mdsts[6].getTenTS();
            String nameofuser = mdsts[7].getTenTS();
            String notice = mdsts[8].getTenTS();
            String numberofcustomer = mdsts[9].getTenTS();
            String quantity = mdsts[10].getTenTS();
            String quantityfood = mdsts[11].getTenTS();
            String quantitytable = mdsts[12].getTenTS();
            String quantityuser = mdsts[13].getTenTS();
            String rightmsg = mdsts[14].getTenTS();
            String table = mdsts[15].getTenTS();
            String viewchart = mdsts[16].getTenTS();
            String year = mdsts[17].getTenTS();

            String msgright = notice + "/" + rightmsg;
            String loaithongke = (String) request.getAttribute("loaithongke");
            String nam = (String) request.getAttribute("year");
%>
<script type="text/javascript">
    function keypress(e){
        //Hàm dùng để ngăn người dùng nhập các ký tự khác ký tự số vào TextBox
        var keypressed = null;
        if (window.event)
        {
            keypressed = window.event.keyCode; //IE
        }
        else
        {
            keypressed = e.which; //NON-IE, Standard
        }
        if (keypressed < 48 || keypressed > 57 )
        { //CharCode của 0 là 48 (Theo bảng mã ASCII)
            //CharCode của 9 là 57 (Theo bảng mã ASCII)
            if (keypressed == 8 || keypressed == 127  )
            {//Phím Delete và Phím Back
                return;
            }
            return false;
        }
    }
</script>
<script type="text/javascript">
    $(function(){
        $('#datepicker1').datepicker($.datepicker.regional['vi']);
        $( "#datepicker1" ).datepicker( "option", "dateFormat","dd/mm/yy");
        $('#datepicker2').datepicker($.datepicker.regional['vi']);
        $( "#datepicker2" ).datepicker( "option", "dateFormat","dd/mm/yy");
    });
</script>
<%
            if (loaithongke.equals("turnoverfood")) {%>

    <div style=" width: 110px; float: left;"><%=datestart%></div>
    <input type="textbox" class="text ngaybd" name="ngaybd" id="datepicker1" onchange="CheckDateStatics()" style=" width: 170px; float: left;">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=enddate%></div>
    <input type="textbox" class="text ngaykt" name="ngaykt" id="datepicker2" onchange="CheckDateStatics()" style=" width: 170px; "><br/>
    <div style=" width: 110px; float: left; margin-top: 20px;"><%=foodgroups%></div>
    <select class="text" name="manhomma" style=" width: 170px; float: left; margin-top: 20px;">
        <option value="all"><%=all%></option>
        <%
                        Vector v = new Vector();
                        NhomMA_Model nma = new NhomMA_Model();
                        v = nma.LayDSNMA(langid);
                        for (int i = 0; i < v.size(); i++) {
                                        Beans.NhomMA nmab = (Beans.NhomMA) v.elementAt(i);%>
        <option value="<%=nmab.getMaNMA()%>"><%=nmab.getTenNMA()%></option>
        <%  }%>
    </select>
    <div style=" width: 110px; float: left; margin-left: 40px; margin-top: 20px;"><%=food%></div>
    <input type="textbox" class="text tenmonan" name="tenmonan" style=" width: 170px; margin-top: 20px;"><br/>
    <div style=" width: 110px; float: left; margin-top: 20px; "><%=quantityfood%></div>
    <input type="textbox" class="text soluong" name="soluong" style=" width: 50px; float: left; margin-top: 20px;" onkeypress="return keypress(event)">
    <div style=" width: 200px; float: right; margin-top: 20px;">
                <input type="checkbox" id="chkchart" name="chkchart" value="a" style="margin-right: 15px;"><%=viewchart%>
    </div>

<%  } else if (loaithongke.equals("turnoveruser")) {%>

    <div style=" width: 110px; float: left;"><%=datestart%></div>
    <input type="textbox" class="text ngaybd" name="ngaybd" id="datepicker1" style=" width: 170px; float: left;">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=enddate%></div>
    <input type="textbox" class="text ngaykt" name="ngaykt" id="datepicker2" style=" width: 170px; "><br/>
    <div style=" width: 110px; float: left; margin-top: 20px;"><%=nameofuser%></div><br/>
    <input type="textbox" class="text tennv" name="tennv" style=" width: 170px; float: left; ">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=quantityuser%></div>
    <input type="textbox" class="text soluong" name="soluong" style=" width: 50px; float: left;" onkeypress="return keypress(event)">

<%  } else if (loaithongke.equals("turnoverarea")) {%>

    <div style=" width: 110px; float: left;"><%=datestart%></div>
    <input type="textbox" class="text ngaybd" name="ngaybd" id="datepicker1" style=" width: 170px; float: left;">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=enddate%></div>
    <input type="textbox" class="text ngaykt" name="ngaykt" id="datepicker2" style=" width: 170px; "><br/>
    <div style=" width: 110px; float: left; margin-top: 20px;"><%=area%></div>
    <select class="text makhuvuc" name="makhuvuc" style=" width: 170px; float: left; margin-top: 20px;">
        <option value="all"><%=all%></option>
        <%
                        Vector v = new Vector();
                        KhuVuc_Model kv = new KhuVuc_Model();
                        v = kv.LayDSKV(langid);
                        for (int i = 0; i < v.size(); i++) {
                            Beans.KhuVuc kvb = (Beans.KhuVuc) v.elementAt(i);%>
        <option value="<%=kvb.getMaKV()%>"><%=kvb.getTenKV()%></option>
        <%  }%>
    </select>
    <div style=" width: 110px; float: left; margin-left: 40px; margin-top: 20px;"><%=table%></div>
    <input type="textbox" class="text tenban" name="tenban" style=" width: 170px; margin-top: 20px; float: left;"><br/>
    <div style=" width: 110px; float: left; margin-top: 20px; "><%=quantitytable%></div>
    <input type="textbox" class="text soluong" name="soluong" style=" width: 50px; margin-top: 20px;" onkeypress="return keypress(event)">
    <div style=" width: 200px; float: right; margin-top: 20px;">
                <input type="checkbox" id="chkchart" name="chkchart" value="a" style="margin-right: 15px;"><%=viewchart%>
    </div>
                
<%  } else if (loaithongke.equals("turnoverbill")) {%>

    <div style=" width: 110px; float: left;"><%=datestart%></div>
    <input type="textbox" class="text ngaybd" name="ngaybd" id="datepicker1" style=" width: 170px; float: left;">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=enddate%></div>
    <input type="textbox" class="text ngaykt" name="ngaykt" id="datepicker2" style=" width: 170px; "><br/>
    <div style=" width: 110px; float: left; margin-top: 20px;"><%=area%></div>
    <select class="text makhuvuc" name="makhuvuc" style=" width: 170px; float: left; margin-top: 20px;">
        <option value="all"><%=all%></option>
        <%
                        Vector v = new Vector();
                        KhuVuc_Model kv = new KhuVuc_Model();
                        v = kv.LayDSKV(langid);
                        for (int i = 0; i < v.size(); i++) {
                            Beans.KhuVuc kvb = (Beans.KhuVuc) v.elementAt(i);%>
        <option value="<%=kvb.getMaKV()%>"><%=kvb.getTenKV()%></option>
        <%  }%>
    </select>
    <div style=" width: 110px; float: left; margin-left: 40px; margin-top: 20px;"><%=table%></div>
    <input type="textbox" class="text tenban" name="tenban" style=" width: 170px; margin-top: 20px; float: left;"><br/>
    <div style=" width: 110px; float: left; margin-top: 20px; "><%=quantitytable%></div>
    <input type="textbox" class="text soluong" name="soluong" style=" width: 50px; margin-top: 20px;" onkeypress="return keypress(event)">

<%  } else if (loaithongke.equals("turnovercustomer")) {%>

    <div style=" width: 110px; float: left;"><%=datestart%></div>
    <input type="textbox" class="text ngaybd" name="ngaybd" id="datepicker1" style=" width: 170px; float: left;">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=enddate%></div>
    <input type="textbox" class="text ngaykt" name="ngaykt" id="datepicker2" style=" width: 170px; "><br/>
    <div style=" width: 110px; float: left; margin-top: 20px;"><%=nameofcustomer%></div><br/>
    <input type="textbox" class="text tenkh" name="tenkh" style=" width: 170px; float: left;">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=numberofcustomer%></div>
    <input type="textbox" class="text soluong" name="soluong" style=" width: 50px; float: left;" onkeypress="return keypress(event)">

<%  } else if (loaithongke.equals("chartturnoverr")) {%>

    <div style=" width: 110px; float: left;"><%=year%></div>
    <select style=" width: 170px;" class="text year" name="year">
        <option><%=Integer.parseInt(nam)%></option>
        <option><%=Integer.parseInt(nam) - 1 %></option>
        <option><%=Integer.parseInt(nam) - 2 %></option>
        <option><%=Integer.parseInt(nam) - 3 %></option>
        <option><%=Integer.parseInt(nam) - 4 %></option>
        <option><%=Integer.parseInt(nam) - 5 %></option>
    </select>

<%  } else {%>

    <div style=" width: 110px; float: left;"><%=datestart%></div>
    <input type="textbox" class="text ngaybd" name="ngaybd" id="datepicker1" style=" width: 170px; float: left;">
    <div style=" width: 110px; float: left; margin-left: 40px;"><%=enddate%></div>
    <input type="textbox" class="text ngaykt" name="ngaykt" id="datepicker2" style=" width: 170px; "><br/>
    <div style=" width: 110px; float: left; margin-top: 20px;"><%=quantity%></div>
    <input type="textbox" class="text soluong" name="soluong" style=" width: 50px; margin-top: 20px; float: left;" onkeypress="return keypress(event)"><br/><br/><br/>

<%  }%>
